package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by lujing on 2018/2/27.
 */
@Getter
@AllArgsConstructor
public enum ProjectTypeEnum {
    PERSONAL_SPEEDLOAN((byte) 1, "极速借个人", 4),
    ORG_SPEEDLOAN((byte) 2, "极速借机构", 0), // 重构前极速借机构数据
    NIIWOO_CLOUD_LOAN((byte) 3, "你我云贷", 0),
    CARD_NIU_LOAN((byte) 4, "卡易借", 5),

    XINYONG((byte) -4, "信用借", 0),  //老系统遗留：4 ————> -4
    QIAOQIAOJIE((byte) -5, "悄悄借", 0),  //老系统遗留：5 ————> -5
    CASHCAR((byte) -6, "现金动车", 0), //老系统遗留：6 ————> -6

    SMALL_LOAN((byte) 8, "小易借", 6),
    SOCIAL_SECURITY_LOAN((byte) 9, "社保借", 7),
    CREDIT_CARD_LOAN((byte) 10, "信用卡借", 8),

    ORG_SPEEDLOAN_NEW((byte) 11, "极速借机构(新)", 9), // 新极速借机构类型
    DECORATION_LOAN((byte) 12, "装修借", 0),
    
    CONSUME_LOAN((byte) 14, "消费贷", 11),//13已被债权标占用
    ;

    private final Byte value;
    private final String desc;
    private final Integer userPrizeSuitProjectType;// 参照com.niiwoo.activity.stage.enums.prize.UserPrizeSuitProjectTypeEnum, 若没有对应的则为0

    public static ProjectTypeEnum getEnum(Byte value) {
        for (ProjectTypeEnum projectTypeEnum : ProjectTypeEnum.values()) {
            if (projectTypeEnum.getValue().equals(value)) {
                return projectTypeEnum;
            }
        }
        throw new NoSuchEnumValueException("ProjectTypeEnum:" + value);
    }
}
